/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package users;

import catalog.CD;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author smoniz
 */
public class User {

    String username, password, name, address, phone;

    public String toString() {
        return username + password + name + address + phone + WishList;


    }

    public User(String username, String password, String name, String address, String phone) {
        this.username = username;
        this.password = password;
        this.name = name;
        this.address = address;
        this.phone = phone;

    }
    ArrayList<CD> WishList = new ArrayList();

    public ArrayList<CD> getWishList() {
        return WishList;
    }

    public String getPassword() {
        return password;
    }

    public String getUsername() {
        return username;
    }

    public void addCD(CD cd) {
        if (!WishList.contains(cd)) {
            WishList.add(cd);
        }
    }

    public void removeCD(CD cd) {
        WishList.remove(cd);
    }

    public void addCDs(List<CD> cds) {
        for (CD cd : cds) {
            if (!WishList.contains(cd)) {
                WishList.add(cd);
            }
        }
    }
}
